Fix FTBFS with Firefox 19

Hi, this fixes the build failure with Firefox 19.

Since Gecko 19, the type "nsresult" is not an integer, but an enum class.
This causes compiler errors when returning the nsresult from a function.

By wrapping nsresult in the NS_ERROR_GET_CODE() macro, we can retrieve the numerical value of the error code.

Regards,
fat-lobyte