A magnitude 5.9 earthquake has struck parts of Pakistan and Afghanistan, causing panic among residents