gdb/python: add gdb.history_count function