Pakistan and Saudi Arabia have signed a "strategic mutual defence" agreement, which declares that any attack on either country will be considered "an aggression against both".