Forth Ports accepted a takeover offer from its largest shareholder that values the UK's last listed ports operator at $1.24 billion.