Dockers beat Swans in scrappy AFL thriller