Bug 1051531. When requesting decode of an image and not asking for some synchronous decoding check is some bytes have been decoding before acquiring the lock in order to avoid waiting on the decoding thread. r=seth

We also need to move the check for if there is work done and subsequent FinishedSomeDecoding call to before acquiring the lock so that we notify if there is work done to notify about.

The pointer value of mDecodeRequest can only be changed on the main thread (and we are on the main thread). It's okay to read the request status without locking it, if the request status changes it shouldn't cause any problems since this FinishedSomeDecoding call is just an optimization.