Set BDJActionQueue to null when shutting down BD-J
check for realloc failures
mpls_parse: added sanity checks
fixed leak when realloc fails
Removed unused bs_eof()
Removed unused file_eof()