scan_options(): reclaim term-references if possible.
FIXED: thread_get_message/1,2: avoid leaking term-references if waiting
is repeatedly interrupted.  This might be an important reason for crashes
in long running servers.  It surely is a bug.