Fix io plugin bin loading

r_bin_load currently clobbers all structures created by an IO Plugin, and this patch creates some checks and additional functions to initialize a core bin object from the IO Plugin structures.