safe_hts_open added to common.h and common.c, processbam cleanup