content-handler.js: fix incorrect call to get_buffer_from_frame
As a result, the fallback on get_recent_conkeror_window() was always
being used, which resulted in non-working downloads in the case where
the user has set browser_default_open_target = OPEN_NEW_WINDOW and the
download link results in a new window being opened by Mozilla.
Additionally, some error messages were added for cases that should not
normally occur, so that other bugs in content-handler.js will be more
easily noticed in the future.