Fix the exception propagation when rejecting workerReadyCapability

Currently when an exception is thrown, we try to reject `workerReadyCapability` with multiple arguments in src/core/api.js. This obviously doesn't work, hence this patch changes that to instead reject with the exception object as is.
In src/core/worker.js the exception is currently (unncessarily) wrapped in an object, so this patch also simplifies that to directly send the exception object instead.
Change `getDocumentError` in web/viewer.js to use `instanceof` instead of the exception name
In test/unit/api_spec.js rename the function `waitsForPromise` to `waitsForPromiseResolved`and add a `waitsForPromiseRejected` function
Add unit test for |MissingPDFException|
Add |UnexpectedResponseException| to fix the exception handling when file loading fails because the server responds with a non 404 status message
Merge pull request #5275 from Snuffleupagus/exception-propagation

Fix the exception propagation when rejecting workerReadyCapability