US vows to stand by Pakistan in ‘hard times’