For Ubuntu 15+, you must use systemd instead of rc.local. You may google "Creating a systemd service" and follow the instructions, but note that redirecting output to /proc/acpi/wakeup is tricky. To get it to work correctly, you must do something like:
/bin/sh -c '/bin/echo XHC > /proc/acpi/wakeup'
Example output for the service file (e.g., /etc/systemd/system/suspendfix.service):
[Unit] Description=fix to prevent system from waking immediately after suspend [Service] ExecStart=/bin/sh -c '/bin/echo XHC > /proc/acpi/wakeup' Type=oneshot RemainAfterExit=yes [Install] WantedBy=multi-user.target