The loophole you're missing is that while $B$ can decide when he measures and what observable he measures, he has no control over what measurement outcome he gets. Thus if they repeat this many times, $A$ will observe some probability distribution over energies, which is exactly what she would get if she had measured first, or even if $B$ hadn't measured at all. With this simple setup, there is no way that $A$ and $B$ can communicate at all, let alone faster than light, and it is faster-than-light communication that sits ill with special relativity, because only that can break causality.
There is still something weird going on, though. If $A$ and $B$ step up their game a little bit, then they can play Bell inequality or CHSH games, in which the correlations between their measurement outcomes are greater than they could possibly be (for a hidden-variable theory) unless they were communicating faster than light.
However, these games are always symmetric in $A$ and $B$. The really weird thing is that whatever entangled state $A$ and $B$ share, they cannot use it to communicate faster than light, because the local outcomes are always random. It's the correlations that are weirdly nonlocal.
As another example, take quantum teleportation. Here $A$ has some quantum state $\psi$ and shares some entangled state $\Psi$ with $B$. By entangling $\psi$ with her half of $\Psi$ and performing a measurement, she can collapse $B$'s half of $\Psi$ into a copy of $\psi$ - and she can do so instantly. Unfortunately, though, $B$'s teleported copy of $\psi$ is scrambled by some unitary operation which depends on $A$'s measurement outcome. To unscramble that unitary, $A$ needs to communicate with $B$ classically, which is at the speed of light or slower, and only then can $B$ get a trustworthy copy of $\psi$. Once again: instant collapse, but no way to use it to communicate.
That said, it is even weirder that this is nonrelativistic quantum theory we're talking about. By taking the usual Schrödinger equation, we're married to a specific observer, and there isn't a formal requirement that the resulting theory not allow instantaneous communication. To do this properly, you really should be using relativistic QM to do quantum information, which is an active field of research (see e.g. RQI-N).